import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history', // 打静态包需要注释
  routes: [
    {
      path: '/',
      redirect: '/new',
      component: resolve => require(['@/components/main/main.vue'], resolve),
      children: [
        {
          path: '/new',
          name: 'New',
          component: resolve => require(['@/components/notebook/new.vue'], resolve)
        },
        {
          path: '/view',
          name: 'View',
          component: resolve => require(['@/components/notebook/view.vue'], resolve)
        },
        {
          path: '/edit/:noteId',
          name: 'Edit',
          component: resolve => require(['@/components/notebook/edit.vue'], resolve)
        }
      ]
    }
  ]
})

